﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using University.Workshop.Presenters;
using University.Workshop.Model;

namespace University.Workshop.WinApp.AmbulanceFolder
{
    public partial class ModifyAmbulanceView : Form, IAmbulance
    {
        AmbulancePresenter presenter;
        Ambulance oldAmbulance;

        public ModifyAmbulanceView(string oldAmbulanceId)
        {
            InitializeComponent();
            presenter = new AmbulancePresenter(this);
            oldAmbulance = AmbulancePresenter.ObtainAmbulance(oldAmbulanceId);
            textBox1.Text = oldAmbulance.AmbulanceId;
            textBox2.Text = oldAmbulance.Model;
            textBox3.Text = oldAmbulance.Year;
            textBox4.Text = oldAmbulance.PurchaseYear;
            
        }

        private void ModifyAmbulanceView_Load(object sender, EventArgs e)
        {

        }

        public string AmbulanceId
        {
            get
            {
                return textBox1.Text;
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public string Model
        {
            get
            {
                return textBox2.Text;
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public string Year
        {
            get
            {
                return textBox3.Text;
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public string PurchaseYear
        {
            get
            {
                return textBox4.Text;
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show(presenter.AmbulanceModify(oldAmbulance.AmbulanceId));
        }


        public string State
        {
            get
            {
                return "Activo";
            }
            set
            {
                throw new NotImplementedException();
            }
        }


        public string Deleted
        {
            get
            {
                return "No";
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
